/* eslint valid-jsdoc: "off" */

'use strict';
/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = exports = {};

  // use for cookie sign key, should change to your own and keep security
  config.keys = `${appInfo.name}_1581644278873_4969`;
  config.security = { // 本地测试中禁用跨域问题检查
    csrf: {
      enable: false,
    },
  };
  config.multipart = {
    mode     : 'stream',
    whitelist: () => true,
  };
  config.redis = {
    client: {
      port    : 6379,          // Redis port
      host    : '127.0.0.1',   // Redis host
      password: '',
      db      : 0,
    },
  };
  config.sequelize = {
    dialect : 'mysql', // support: mysql, mariadb, postgres, mssql
    database: 'zeeephrback',
    host    : 'localhost',
    port    : 3306,
    username: 'root',
    password: 'mysql',
  };
  config.redis = {
    client: {
      port    : 6379,          // Redis port
      host    : '127.0.0.1',   // Redis host
      password: '',
      db      : 0,
    },
  };
  config.session = {
    key     : 'EGG_SESS',
    maxAge  : 'session', // 1 天
    httpOnly: true,
    encrypt : true,
  };

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };
  return {
    ...config,
    ...userConfig,
  };
};
